package com.sci.web.action.register;

import com.opensymphony.xwork2.ActionContext;
import com.sci.web.action.util.BaseAction;
/**
 * 
 * @author  BaiFuyou
 * @date: Sep 27, 2011 9:49:03 PM
 * 
 * 获取验证码
 */
public class ValidateCodeAction extends BaseAction{

	/**
	 * 
	 */
	private static final long serialVersionUID = 2412645190668902335L;
	
	private String msg;
	private boolean success;
	/**
	 * @return the msg
	 */
	public String getMsg() {
		return msg;
	}
	/**
	 * @param msg the msg to set
	 */
	public void setMsg(String msg) {
		this.msg = msg;
	}
	/**
	 * @return the success
	 */
	public boolean isSuccess() {
		return success;
	}
	/**
	 * @param success the success to set
	 */
	public void setSuccess(boolean success) {
		this.success = success;
	}
	
	@Override
	public String execute() throws Exception {
		// TODO Auto-generated method stub
		super.setContentType(super.JSON);
		msg = (String)ActionContext.getContext().getSession().get("rand");
		this.success = true;
//		System.out.println(msg+"=随机码");
		super.outPrint(msg);
		return "json";
	}

}
